<script setup>
import { ref } from 'vue'

// ref函数返回的数据不再是基础类型了
const name = ref('晓燕')
const change = () => {
  name.value = '洪云'
  const age = 19
}
// setup语法糖不用显式的写return返回数据,会自动return顶层(script标签最外层)的变量和方法
</script>

<template>
  <div>
    name: {{name}} ---- age: 
    <button @click="change">改名字</button>
  </div>
</template>

<style lang="scss" scoped></style>
